function showWinAddCompany(){
	Ext.QuickTips.init();
	var formInput = Ext.widget({
		id		: 'formInput',
		xtype	: 'form',
		frame	: false,
	    width	: 400,
		height	: 250,
		bodyPadding: 10,
		region 	: 'center',
		defaults: {
				msgTarget   : 'side',
				labelWidth: 75
			},
		items	: [{
					xtype			: 'textfield',
					allowBlank		: false,
					width			: 300,
					fieldLabel		: 'Company',
					id				: 'company'
				},{
					xtype			: 'textareafield',
					allowBlank		: true,
					width			: 300,
					fieldLabel		: 'Address',
					id				: 'address'
				}],
			buttonAlign: 'center',
			buttons:[
						{
							text: 'Insert',
							handler: function(){
								if(formInput.getForm().isValid()){
									var values = Ext.getCmp('formInput').getValues();
									Ext.Ajax.request({
										url: base_url+'/Company/CompanyCrud/insert',
										params: values,
										method:'POST',
										success: function(response) {
												var obj = Ext.decode(response.responseText);
												if(obj.feedback[0].code==1){
													Ext.MessageBox.show({
													   title: 'Caution',
													   msg: obj.feedback[0].message,
													   buttons: Ext.MessageBox.OK
												   });
												   winAdd.close(function(){document.body.removeChild(document.getElementById("winAdd"))});
												   strCompany.load();
												}
												else{
													Ext.MessageBox.show({
													   title: 'Caution',
													   msg: obj.feedback[0].message,
													   buttons: Ext.MessageBox.OK,
													   icon: Ext.MessageBox.ERROR
												   });
												}
										}
									});
								}
							}
							},{
								text	: 'Reset',
								handler: function(){
									Ext.getCmp('Company').reset();
									Ext.getCmp('textareafield').reset();
								}
							}
			]
    });
    var winAdd = new Ext.create('widget.window', {
                title	: 'Company Setting Input Data',
                closable:true,
                width:400,
                height:250,
                modal:true,
                //border:false,
				id:'winAdd',
                plain:true,
                closeAction: 'close',
                layout: 'border',
				listeners:{
					'close':function(){document.body.removeChild(document.getElementById("winAdd"));}
				},
                items: [formInput]
            });
	winAdd.show();		
}
	//EDIT WINDOW
function showWinEditCompany(){
	Ext.QuickTips.init();
	var formEdit = Ext.widget({
    id		: 'formEdit',
	xtype	: 'form',
	width	: 400,
    height	: 250,
	bodyPadding: 10,
    region 	: 'center',
    defaults: {
            msgTarget   : 'side',
			labelWidth: 75
        },
	items	: [{
					xtype			: 'hidden',
					allowBlank		: false,
					id				: 'id'
				},{
					xtype			: 'textfield',
					allowBlank		: false,
					width			: 300,
					fieldLabel		: 'Company',
					id				: 'company'
				},{
					xtype			: 'textareafield',
					allowBlank		: true,
					width			: 300,
					fieldLabel		: 'Address',
					id				: 'address'
				}],
        buttonAlign: 'center',
        buttons:[
                    {
                        text: 'Save',
                        handler: function(){
							var values = Ext.getCmp('formEdit').getValues();
                            Ext.Ajax.request({
								url: base_url+'/Company/CompanyCrud/update',
								params: values,
								method:'POST',
								success: function(response) {
										var obj = Ext.decode(response.responseText);
										if(obj.feedback[0].code==1){
											Ext.MessageBox.show({
											   title: 'Caution',
											   msg: obj.feedback[0].message,
											   buttons: Ext.MessageBox.OK
										   });
										   winEdit.close(function(){document.body.removeChild(document.getElementById("winEdit"))});
										   strCompany.load();
										}
										else{
											Ext.MessageBox.show({
											   title: 'Caution',
											   msg: obj.feedback[0].message,
											   buttons: Ext.MessageBox.OK,
											   icon: Ext.MessageBox.ERROR
										   });
										}
									}
								});

                        }
                        },{
                            text	: 'Reset',
                            handler: function(){
                                rec = gridCompany.getSelectionModel().getSelection()[0];
								Ext.getCmp('id').setValue(rec.get('ID'));
								Ext.getCmp('address').setValue(rec.get('ADDRESS'));
								Ext.getCmp('company').setValue(rec.get('COMPANY'));
                            }
                        }
        ]
    });
    var winEdit = new Ext.create('widget.window', {
                title	: 'User Edit Data',
                closable:true,
                width:400,
                height:250,
                modal:true,
                //border:false,
                plain:true,
				closeAction: 'close',
                layout: 'border',
				id:'winEdit',
				listeners:{
					'close':function(){document.body.removeChild(document.getElementById("winEdit"));}
				},
                items: [formEdit]
            });
		winEdit.show();
}